layui.define(['index', 'form', 'table', 'laypage', 'layedit'], function (exports) {
    let $ = layui.$;
    let form = layui.form;
    let layer = layui.layer;
    let table = layui.table;
    let laypage = layui.laypage;

    table.init('zmn-table', {
        toolbar: "#zmn-table-tool",
        defaultToolbar: json.hasExportExcel ? ['filter', 'exports'] : ['filter'], done: function () {
            $("div[lay-event='LAYTABLE_EXPORT']").attr('lay-event', 'CUSTOM_EXPORT');
        },
        page: true,
        limit: json.pageSize,
        height: 'full-94'
    });
    laypage.render(zmnPage.laypageOptions(json));

    //头工具栏事件
    table.on('toolbar(zmn-table)', function (obj) {
        let checkStatus = table.checkStatus(obj.config.id); //获取选中行状态
        if (obj.event === "choose") {
            let data = checkStatus.data;
            let newObj = data[0];
            if (newObj != null && newObj != undefined && newObj.standardId != null && newObj.standardId != "" && newObj != undefined) {
                parent.pushNoticeDetailPage.getSonPageValueSetUrl(newObj.standardId);
                let index = parent.layer.getFrameIndex(window.name);
                parent.layer.close(index);
            } else {
                layer.msg("请选择一个标准文库数据", {"icon": 2});
            }
        }
    });

    //对外暴露的接口
    exports('push_notice_stdlib', {});
});

